home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / 226_01.zip / MANUAL.TXT < prev    next >
Text File  |  1993-04-21  |  22KB  |  382 lines

  1.                                  ART-CEE
  2.                               USER'S GUIDE
  3.  
  4.      ART-CEE is a generic inference engine.  It was written in MIX C on an
  5. Apricot F1, a run-of-the-mill MS-DOS machine.  The source and load modules
  6. have been successfully compiled and executed on IBM XT, AT and clone machines
  7. and should port easily to any MS-DOS machine.  The source code also should
  8. be fairly easy to convert to other C dialects.
  9.  
  10.      Inference engines are a category of artificial intelligence programs.
  11. Like traditional databases, they structure information for later retrieval.
  12. But they also allow can guide the user through solving problems, point out
  13. unnoticed connections within the data and suggest new possibilities.  They
  14. are capable of working with certainties as well as 'fuzzy' information
  15. which is incomplete or tentative.
  16.  
  17.      Information is entered into inferences engines as rules.  In ART-CEE's
  18. case, these rules are "If...then" propositions.  Such rules should be closely
  19. related and basic to the body of knowledge concerned; the quality of the
  20. system built with the inference engine depends most on the accuracy and ade-
  21. quacy of these rules.  The user should enter enough rules to draw the major
  22. connections between the data items, but there is no need to enter everything
  23. that there is to know--after all, inference engines are designed to draw
  24. their own inferences.
  25.  
  26.      Information is retrieved from inference engines through queries.  A query
  27. is a question or a command which causes the inference engine to search the
  28. database, extract the information it knows immediately and/or draw the
  29. necessary inferences to come as close as possible to meeting the request, and
  30. display both its conclusions and how it arrived at them.  ART-CEE has three
  31. kinds of queries that allow a broad range of services to you.
  32.  
  33.      Each rule in ART-CEE is associated with a percentage of truth, occurrence
  34. or certainty.  If the rule is always true its percentage is 100; if it is
  35. never true its percentage is 0.  ART-CEE also uses this number of mark some
  36. rules as logically impossible and to prevent the entering of tautologies.
  37. These percentages are used to control the query process.
  38.  
  39.  
  40. GETTING STARTED
  41.      Before you do anything, make a copy of all ART-CEE files, hide that
  42. copy from neighbors, friends, angry spouses, magnetic fields, dust and
  43. nuclear explosion.
  44.  
  45.      ART-CEE is delivered as four source files.  Compile each source file
  46. individually.  If you are using the MIX system, you may wish to optimize
  47. WORKUP2.C for speed.  Then link the four object files together and name the
  48. output file ART-CEE.COM.  The program will run faster if you link the runtime
  49. functions with the WORKUP objects, but this will increase the size of the
  50. final .COM file to above 60K.
  51.  
  52.      If you find that ART-CEE's space requirements exceed what is available,
  53. the amount of 'stack' and 'heap' used can be affected greatly by adjusting
  54. the value of MAX in the header files.  ART-CEE is supplied with a value of 60
  55. for that variable.  All source files use carry exactly the same value for MAX.
  56.  
  57.      Locate the following files in the same directory on the default drive:
  58. ART-CEE.COM, HELP1.AIH, HELP2.AIH, HELP3.AIH, HELP4.AIH.  If you chose not to
  59. link the MIX runtime functions with the WORKUP objects, the MIX C library
  60. functions also must reside in that directory, unless a PATH command has been
  61. executed.  The runtime module also must have access to the MS-DOS i-o routines
  62. on the system disk; screen blanking will not succeeed if these routines are
  63. not available on the default drive or through a PATH command.
  64.  
  65.  
  66. MAIN MENU AND PROMPT
  67.      The main input screen displays a menu of all available input options.
  68.  
  69.      Commands and default settings may be addressed by entering the single
  70. letter in the appropriate menu phrase.  For instance, to load a data file,
  71. enter "L".  Usually the letter to be entered is the first letter in the
  72. phrase, but in any case it is the only capitalized letter.  Do not enter
  73. the full word or phrase; ART-CEE will try to interpret that entry as a rule
  74. or subject.  ART-CEE will convert your inputs to all-capitals; the program
  75. will execute more quickly if you enter them as capitals in the first place.
  76. All inputs to ART-CEE must end in the "Return" or "Enter" key.  Beginning with
  77. version 1.4, inputs are processed without regard to case.
  78.  
  79.      Rules and queries demand a more involved input.  Any input at the main
  80. prompt that is longer than one character will be treated as a rule or query.
  81.  
  82.  
  83. RULES
  84.      All rules must begin with the word "IF " and contain the word " THEN ".
  85. Between these words must be a subject, and after the " THEN " must be a
  86. predicate (apologies to English teachers who know that such phrases are not
  87. grammatical subjects and predicates).  The entire rule cannot be longer than
  88. eighty characters.  Neither subject nor predicate should contain punctuation.
  89. It follows that the rule should not end in punctuation (the reason for this is
  90. that later matching against the predicate would have to include the same
  91. punctuation, which probably would be incorrect for that usage and a mess to
  92. remember).  Any leading grammatical article ("A ", "AN " or "THE ") in sub-
  93. ject or predicate will be ignored.
  94.  
  95.      ART-CEE searches the database on each rule input to determine if it already
  96. knows the subject or predicate.  If it finds that the rule already exists, you
  97. are given the opportunity to enter new percentages of occurrence for that rule.
  98. Otherwise, if there is room in the database for the new rule, the rule is
  99. added to the knowledge base.  If override of default percentages is turned on,
  100. you are asked to input forward and reverse percents.  Otherwise the defaults
  101. are used.
  102.  
  103.      ART-CEE can handle up to MAX number of different subjects and/or predi-
  104. cates.  Internally, subjects and predicates are stored identically, as the
  105. subject of one rule likely will be the predicate of another.  The maximum
  106. number of rules that can be handled is MAX * (MAX -1).
  107.  
  108.      A forward percentage of occurrence refers to the percent of time that
  109. the rule is true as entered.  If fifty percent of all humans are female, then
  110. the rule "IF HUMAN THEN FEMALE" would have a forward percentage of 50.00000
  111. (trailing zeroes need not be entered).  Reverse percentages refer to the
  112. percent of time that the rule is true in reverse format.  Using the example
  113. above, if one percent of all females are human, the reverse percentage for
  114. "IF HUMAN THEN FEMALE" would be 1.000000.  Percentages must be not less than
  115. zero (zero means "never true") and less than one hundred (one hundred means
  116. "always true").  ART-CEE stores impossible rules with negative percentages
  117. of occurrence, but you cannot enter them at rule entry time (see commands B
  118. and G).
  119.  
  120.  
  121. QUERIES
  122.      Three query formats are available in ART-CEE:  simple query, two-element
  123. query and thinking.
  124.  
  125.      The simple query is a request for all rules concerning just one subject
  126. in the database.  It reports only those rules which contain the subject as
  127. subject or predicate; no inferences are drawn.  Only positive rules are
  128. reported; if a potential rule has not been entered, or if the rule is marked
  129. as impossible, it is not reported.  Simple queries are entered by entering
  130. any of the following phrases, followed by the subject:  WHO, WHO IS, WHO IS A,
  131. WHO IS AN, WHO IS THE, WHAT, WHAT IS, WHAT IS A, WHAT IS AN, WHAT IS THE,
  132. DESCRIBE, DESCRIBE A, DESCRIBE AN, or DESCRIBE THE.  The subject may be
  133. followed by a question mark, which is ignored.  ART-CEE searches the database
  134. for an exact match on the subject.  If the subject is found, all forward
  135. rules for that subject are reported to the computer monitor, followed by all
  136. reverse rules.
  137.  
  138.      The two-element query asks is a certain rule is true.  Using the above
  139. example, to find out what percentage of all females are human, the input
  140. would be:  "IF FEMALE THEN HUMAN?"  Note that the input is exactly like
  141. the input for the entering of the rule, except that the rule ends in a ques-
  142. tion mark.  All parsing rules applicable for rules are applicable for two-
  143. element queries.  If subject and predicate are in the database, the query
  144. begins.  If the rule already exists in the database it is reported, and the
  145. query search ends.  If the rule does not exist (ie., is marked as having a
  146. zero percentage of occurrence), ART-CEE attempts to find any way possible to
  147. chain together enough inferences to draw a conclusion about the rule.  For
  148. instance, suppose that ART-CEE does not know directly how many females are
  149. human, but it does know the following rules:
  150.      IF FEMALE THEN MAMMAL   20%
  151.      IF MAMMAL THEN HUMAN     3%
  152. ART-CEE will link these two rules together and conclude that the rule "IF
  153. FEMALE THEN HUMAN" is true 0.6% of the time (20% times 3%).  It reports
  154. the chain that it used to draw this conclusion on the monitor and asks if
  155. you agree with each step in the chain.  If you disagree with any step, the
  156. entire chain beginning with the part that you rejected is abandoned, and
  157. the search continues.  If you agree with the entire chain you will be asked
  158. if you wish to add the new fact ("IF FEMALE THEN HUMAN" 0.6%) to the data-
  159. base and complies with your decision.  The search resumes to find other ways
  160. that FEMALE and HUMAN can be linked until all possible links have been
  161. examined.
  162.  
  163.      The two-element query also can work with incomplete data.  Sometimes it
  164. is possible to make a connection between two subjects only if one additional
  165. rule is assumed to be true.  For instance, suppose that the following rules
  166. are known:
  167.      IF FEMALE THEN MAMMAL      20%
  168.      IF MAMMAL THEN TWO-LEGGED   3%
  169.      IF TAILLESS THEN HUMAN     10%
  170. ART-CEE cannot conclude IF FEMALE THEN HUMAN unless one of the following
  171. assumptions is made:  FEMALEs are TAILLESS, MAMMALs are TAILLESS, TWO-LEGGED
  172. implies TAILLESS, MAMMALs are HUMAN or TWO-LEGGED implies HUMAN.  By setting
  173. the default number of assumptions on the main menu (function A), the number
  174. of assumptions which will be included in each attempt to chain subjects to-
  175. gether is controlled.  Changing the number of assumptions to 1 allows 1 
  176. such assumption per attempt, etc.  The maximum number of assumptions allowed
  177. in any one chain is MAX - 3.  Increasing the number of allowed assumptions
  178. increases the power of the two-element query, but is also geometrically in-
  179. creases the effort both program and user must exert to get through the query.
  180. If the number of assumptions is nonzero ART-CEE may request information from the
  181. user at what seems to be odd moments.  When the user is asked to agree to the
  182. assumption as drawn, a "Y" response will result in the new rule's addition
  183. to the database, and the user will be asked for the percentage of occurrence
  184. for that rule, whether or not the override of defaults is on.
  185.  
  186.      The final query form, "thinking", is an automated extension of the two-
  187. element query.  Every subject in the database is chained to every other sub-
  188. ject in the database.  Before the query is executed, ART-CEE goes through the
  189. database marking all logical impossibilities.  These impossibilities take
  190. the form of:
  191.      IF A THEN B cannot be true (ie., IF A THEN B has a negative percentage)
  192.      IF C THEN B is always true (ie., IF C THEN B has a 100% percentage)
  193.      Therefore, IF A THEN C can never be true.
  194. Then ART-CEE begins chaining.  Only rules with positive percentages are in-
  195. cluded in the chains (ie., no assumptions are drawn).  All chains are extended
  196. as far as they will go, up to the think depth setting shown on the main menu.
  197. That is, if the think depth setting is 3, then no chain will be extended be-
  198. yond three subjects.  The minimum depth setting is three, and the maximum
  199. setting is MAX - 1.  While increasing the depth setting increases the prob-
  200. ability of finding all possible inferences, it also greatly increases the
  201. time necessary to perform the query.  Seldom does a depth of more than four
  202. or five prove efficient.  All connections drawn in the "thinking" function
  203. are applied to the database, and the greatest percentage found for each rule
  204. is the final one saved in the database.  No impossible rules are changed.
  205.  
  206.  
  207. COMMANDS
  208.      A brief discussion of each rule follows, each prefixed by the single-
  209. character entry that invokes the rule.
  210.  
  211.      A  Set number of assumptions that will be allowed in any single chain
  212.         in the two-element query.  Minimum number is 0; maximum is MAX - 3.
  213.  
  214.      B  Enter a file containing mutually exclusive subjects, and mark all
  215.         occurrences of those subjects in the database as mutually exclusive.
  216.         For instance, assume that a file contains the following facts:
  217.         DOG, CAT, PIG, HORSE, COW.  Assume also that the database contains
  218.         the subjects DOG, CAT, HORSE, COW.  This rule will mark the follow-
  219.         ing rules as impossible:
  220.            IF DOG THEN CAT      IF DOG THEN HORSE       IF DOG THEN COW
  221.            IF CAT THEN DOG      IF CAT THEN HORSE       IF CAT THEN COW
  222.            IF HORSE THEN DOG    IF HORSE THEN CAT       IF HORSE THEN COW
  223.            IF COW THEN DOG      IF COW THEN HORSE       IF COW THEN CAT
  224.         The PIG item in the file is ignored.
  225.  
  226.      C  Change a subject without changing any percentages associated with it.
  227.         For instance, the subject "PIG" could be changed to "SWINE".  Then
  228.         all rules that referenced "PIG" will now reference "SWINE".
  229.  
  230.      D  Drop a rule.  Suppose that the database contains the rule "IF COLLIE
  231.         THEN DOG".  By selecting this option, the rule can be marked as having
  232.         a zero percentage of occurrence.  If this is the only rule referencing
  233.         COLLIE, then the subject COLLIE is erased.  The same would occur to
  234.         DOG is this was the only rule referencing DOG.
  235.  
  236.      F  Set default forward percentage of occurrence.  Valid values for this
  237.         default are not less than zero and not greater than one hundred.  This
  238.         setting can be used to great advantage if a large number of similarly-
  239.         occurring rules are to be entered at the same setting.  Set the default
  240.         appropriately, set the default reverse percentage as well, turn off
  241.         the override option, and just enter the rules.  All prompts for per-
  242.         centage inputs will be skipped.
  243.  
  244.      G  Enter a group of mutually exclusive subjects from the keyboard.  The
  245.         function works the same way as "B", except that the keyboard is the
  246.         source of information.  A single letter "E" ends the input stream and
  247.         begins the marking of subjects.  Any number of subjects can be en-
  248.         tered, but only those actually found in the database will be stored.
  249.         After the subjects are marked, you will be given opportunity to save
  250.         the group for later use as an input file under option "B".
  251.  
  252.      H  Help screens are available online.  These screens are an abbreviated
  253.         version of this user's guide.  The function will work only if the
  254.         help files are located in the default directory on the default drive
  255.         or an MS-DOS PATH command was issued prior to entering ART-CEE.
  256.  
  257.      I  Initialize the database.  This function erases all subjects in the
  258.         databased marks all percentages of occurrence as zero except for
  259.         tautologies (IF A THEN A), which are marked as impossible.
  260.  
  261.      K  Set depth of thinking chaining.  See the discussion of thinking under
  262.         queries, above.
  263.  
  264.      L  Load a data file from disk.  The database developed in a previous
  265.         ART-CEE session can be reloaded using this function.  If the file con-
  266.         tains fewer than MAX subjects, the data in the file will overlay the
  267.         contents of the database now occupying the positions from which the
  268.         file was written and leave the remainder of the database untouched.  If
  269.         the highest-numbered subject in the file exceeds the current value of
  270.         MAX, the file cannot be successfully loaded.
  271.  
  272.      M  Toggle the showing of the main menu.  If the current setting is "Y"
  273.         (show the menu), choosing this function will change the setting to
  274.         "N" (do not show the menu).  Once the commands and query/rule format
  275.         are well-known, significant time can be saved by switching the setting
  276.         to "N".
  277.  
  278.      O  Toggle the overriding of default percentages of occurrence.  If the
  279.         current setting is "Y" (yes), choosing this function will change the
  280.         setting to "N" (no), and vice versa.
  281.  
  282.      P  Print the database.  All rules in the database will be copied to the
  283.         printer (LPT1), together with their percentages of occurrence.  These
  284.         rules will be grouped by subject, all forward references first and
  285.         then∞ reverse references.  Therefore, all rules will be printed
  286.         twice.  If all subjects are used and all subjects have a completely
  287.         filled set of rules, the number of lines printed will be MAX * 2 *
  288.         (MAX + 2).
  289.  
  290.      R  Set the default percentage used for reverse references.  Valid values
  291.         are not less than zero and not greater than one hundred.
  292.  
  293.      S  Save the database to disk.  The database can be saved in whole or
  294.         in part.  To save just part of the database, enter the starting and
  295.         ending positions when prompted (use function V to determine what
  296.         subject is in what position).  If the present database was loaded
  297.         from disk, the filename from which the database was loaded will be
  298.         offered to you as a default, otherwise the filename "ART-CEE.DAT" will
  299.         be offered.  The default can be overridden by entering any other
  300.         name when prompted.  If a file by the chosen name already exists, it
  301.         will be overwritten without backup.
  302.  
  303.      T  Think.  See discussion under "QUERIES".
  304.  
  305.      V  View the database.  All used subjects are listed in order of entry,
  306.         followed by the number of forward references and number of reverse
  307.         references for each.
  308.  
  309.      X  Exit the program.  You will be asked if you wish to save the database
  310.         before the exit occurs.  The default is not to save the database.
  311.  
  312.  
  313. ART-CEE AND DATA STRUCTURES
  314.      Like all software, ART-CEE has to deal with four possible relationships
  315. within the data it handles.  The simplest and least significant is the one-
  316. to-one relationship.  An item in the database has just one connection with
  317. one other item in the database, and that's all.  "IF A then B" defines such
  318. a relationship.  If "A" is true then "B" is always true; if it were other-
  319. wise, the rule would be just one part of a larger set of truths, and "A" 
  320. would connect with at least one more item besides "B".
  321.  
  322.      The one-to-many relationship involves multiple possibilities rising
  323. from the same item.  "If A then B" is true part of the time, and "If A then
  324. C" also is true part of the time, but "B" and "C" cannot be true at the
  325. same time.  
  326.  
  327.      The many-to-one relationship is created by such combinations as "If C
  328. then A" and "If B then A".  Two items have the same kind of relationship 
  329. with another item in the database; they lead to the same conclusion.  This
  330. relationship is not the same as "If C then if B then A".
  331.  
  332.      Finally, the many-to-many relationship combines the one-to-many and
  333. many-to-one relationships.  The following rules constitute a many-to-many
  334. relationship:
  335.        If A then B.
  336.        If A then C.
  337.        If C then B.
  338.        If B then C.
  339. The relationships between items intertwine.
  340.  
  341.      Expressing one-to-one relationships with ART-CEE is straightforward.
  342. Just enter a new rule.  However, unless more rules are entered, transforming
  343. the one-to-one into one of the other types, the one-to-one relationship
  344. amounts to little more than a redefinition of the subject.
  345.  
  346.      One-to-many and many-to-one relationships are created by entering
  347. several rules having items in common on the 'many' side of the relationship.
  348. The grouping functions (commands 'B' and 'G') are then used to mark these
  349. common elements as having a mutually exclusive relationship with each
  350. other. The result is a hierarchy of information that can be diagrammed as
  351. a triangle:
  352.              A                        B        C
  353.            /  \                        \     /
  354.           /    \          or            \   /
  355.          B      C                         A
  356. Use of the grouping functions assures that all relationships in the
  357. above diagrams are vertical ("If B then C" and vice versa cannot be
  358. true without transforming the relationships into the many-to-many kind).
  359. This structure is appropriate for classification schemes, diagnosis patterns
  360. and family trees.
  361.  
  362.      Many-to-many relationships form a more nebulous pattern in which each
  363. element theoretically can rise from and lead to every other item.  Such
  364. structures can be used to identify patterns in which statistics are known
  365. about the data but overall structure of the data is unclear.  Many-to-
  366. many patterns can also be used to interrelate two or more hierarchies.
  367.   
  368.      The big factor with ART-CEE is that ART-CEE just loves to transform hier-
  369. archies (many-to-one and one-to-many relationships) into many-to-many forms.
  370. The drawing of inferences in the way that ART-CEE does this transformation.
  371. If you have build a hierarchical structure and want to keep it that way,
  372. be careful to do the following:
  373.      1.  Do not use the 'think' function against your permanent database.
  374.      2.  Do not add query findings to the database.
  375.      3.  Do not use assumptions.
  376.      4.  Use the 'grouping' functions completely.
  377. If you wish to break any of the above, be sure to save the database first,
  378. then do not save the database when exiting from ART-CEE.  Of course, if you
  379. are working with a nebulous, highly interconnected database to begin with, 
  380. feel free to infer to your heart's content.
  381.   
  382.